home *** CD-ROM | disk | FTP | other *** search
- /*=====[ The TesSeRact(TM) CXL User Interface Development System ]======*
- | Copyright (c) 1987-1990, Innovative Data Concepts. All Rights Reserved
- |
- | This Library is part of IDC's TesSeRact Development Tools product
- | line. For information about other IDC products, call 1-215-884-3373.
- *----------------------------------------------------------------------*
- | <TCXLfmt.h> : Definitions and prototypes for TCXL format-string input
- | functions.
- *----------------------------------------------------------------------*
- | PGS : $Id: tcxlfmt.h 5.51 90/10/01 00:00:00 MLM Release Locker: MLM $
- | $Log: tcxlfmt.h $
- | Revision 5.51 90/10/01 00:00:00 MLM
- | TCXL 5.51
- |
- *======================================================================*/
- #ifndef _TCXLfmt_
- # define _TCXLfmt_ 1
- # ifndef _TCXLdef_
- # include <TCXLdef.h>
- # endif
- /*- format-options -----*/
- #define FMT_CPY 0x01 /* 'C' copy to output */
- #define FMT_ESC 0x02 /* 'E' [Esc] detect */
- #define FMT_RTN 0x04 /* 'R' [CR] detect */
- #define FMT_PAS 0x08 /* 'P' password */
- #define FMT_LWR 0x10 /* 'L' lower case */
- #define FMT_MIX 0x20 /* 'M' mixed case */
- #define FMT_UPR 0x40 /* 'U' upper case */
- #define FMT_CNV 0x70 /* 'L|M|U' convert */
- #define FMT_END 0x80 /* end-of-format */
- #define FMT_TRM 0x84 /* end | 'R' terminate */
- #define FMT_INI 0x06 /* 'E|R' initial */
- /*- format-usages ------*/
- #define FMT_GET 0x00 /* KvGetFmt(), etc. */
- #define FMT_WIN 0x01 /* KwGetFmt(), etc. */
- #define FMT_ENT 0x02 /* EntFld() */
- #define FMT_NUM 0x04 /* decimal field */
- #define FMT_CUR 0x08 /* currency field */
-
- /*------------------[ Data objects and access macros ]-----------------*/
-
- TYP struct Fmt FmtT;
- struct Fmt /*-[ Format-control object ]-----*/
- { ChrP ftgl; /* 00|00 : option toggle string */
- ChrP fchr; /* 02|04 : control char string */
- VfiCP fput; /* 04|08 : backspace function */
- BytT flen; /* 06|0C : input field length */
- BytT fdec; /* 07|0D : decimal position */
- BytT fopt; /* 08|0E : option state */
- BytT fuse; /* 09|0F : usage state */
- ChrT fpfx; /* 0A|10 : currency-prefix char */
- ChrT fsep; /* 0B|11 : currency-separator */
- ChrT fsfx; /* 0C|12 : currency-suffix char */
- BytT ffut[3]; /* 0D|13 : reserved for future */
- }; /* 10|16 ]-----------------------*/
-
- GBL FmtT CDC _FmtCtl; /*- Global format-control object ---------*/
- #define FmtTgl (_FmtCtl.ftgl) /* option chars */
- #define FmtChr (_FmtCtl.fchr) /* control chars */
- #define FmtPut (_FmtCtl.fput) /* backspace function */
- #define FmtLen (_FmtCtl.flen) /* field length */
- #define FmtDec (_FmtCtl.fdec) /* decimal position */
- #define FmtOpt (_FmtCtl.fopt) /* option state */
- #define FmtCpy (0 != (FmtOpt & FMT_CPY)) /* copy to output */
- #define FmtEsc (0 != (FmtOpt & FMT_ESC)) /* [Esc] detect */
- #define FmtRtn (0 != (FmtOpt & FMT_RTN)) /* [CR] detect */
- #define FmtPas (0 != (FmtOpt & FMT_PAS)) /* password */
- #define FmtLwr (0 != (FmtOpt & FMT_LWR)) /* lower case */
- #define FmtMix (0 != (FmtOpt & FMT_MIX)) /* mixed case */
- #define FmtUpr (0 != (FmtOpt & FMT_UPR)) /* upper case */
- #define FmtCnv (0 != (FmtOpt & FMT_CNV)) /* convert */
- #define FmtEnd (0 != (FmtOpt & FMT_END)) /* end-of-format */
- #define FmtTrm (0 != (FmtOpt & FMT_TRM)) /* terminate */
- #define FmtUse (_FmtCtl.fuse) /* usage state */
- #define FmtGet (0 != (FmtUse & FMT_GET)) /* KvGetFmt(), etc */
- #define FmtWin (0 != (FmtUse & FMT_WIN)) /* KwGetFmt(), etc */
- #define FmtEnt (0 != (FmtUse & FMT_ENT)) /* EntFld() */
- #define FmtNum (0 != (FmtUse & FMT_NUM)) /* decimal */
- #define FmtCur (0 != (FmtUse & FMT_CUR)) /* currency */
- #define FmtPfx (_FmtCtl.fpfx) /* currency prefix */
- #define FmtSep (_FmtCtl.fsep) /* currency separator */
- #define FmtSfx (_FmtCtl.fsfx) /* currency suffix */
-
- /*------------------------[ Function prototypes ]-----------------------*/
-
- #ifdef __cplusplus /* no mangling, please */
- extern "C" {
- #endif
- VOID CTYP FmtBack(ChrI f, ChrI o); /* Backspace format */
- IntT CTYP FmtChar(IntT c, IntT f); /* Validate character */
- IntT CTYP FmtExcl(ChrI f, IntT c); /* Exclusion-set */
- VOID CTYP FmtFlip(IntT c); /* Toggle option */
- IntT CTYP FmtIncl(ChrI f, IntT c); /* Inclusion set */
- IntT CTYP FmtInit(ChrP f, IntT u); /* Inititalize and verify format */
- VOID FmtPutF(VfiCP f); /* Assign backspace function */
- #define FmtPutF(f) (FmtPut = (f))
- #ifdef __cplusplus
- }
- #endif
- #endif /* _TCXLfmt_ : End of TCXLfmt.h */